package ooExercise.ooday03;

public class AnimalTest {
    public static void main(String[] args) {
        Dog[] dogs=new Dog[3];
        dogs[0]=new Dog("阿芬",99,"黑");
        dogs[1]=new Dog("南瓜",19,"银");
        dogs[2]=new Dog("吞吞",15,"白");
        for(int i=0;i<dogs.length;i++){
            System.out.println("名字："+dogs[i].name+",年龄："+dogs[i].age+",颜色："+dogs[i].color);
            dogs[i].lookHome();
            dogs[i].eat();
            dogs[i].swim();
            dogs[i].drink();
        }
        Chick[] chicks=new Chick[2];
        chicks[0]=new Chick("小芬",50,"黑");
        chicks[1]=new Chick("小黑",25,"绿");
        for(int i=0;i<chicks.length;i++){
            System.out.println("名字："+chicks[i].name+",年龄："+chicks[i].age+",颜色："+chicks[i].color);
            chicks[i].eat();
            chicks[i].drink();
            chicks[i].layEggs();
        }
        Fish[] fish=new Fish[4];
        fish[0]=new Fish("阿花",12,"白");
        fish[1]=new Fish("阿花",14,"黑");
        fish[2]=new Fish("小七",5,"黄");
        fish[3]=new Fish("阿浩",10,"银");
        for(int i=0;i< fish.length;i++){
            System.out.println("名字："+fish[i].name+",年龄："+fish[i].age+",颜色："+fish[i].color);
            fish[i].eat();
            fish[i].swim();
            fish[i].drink();
        }
    }
}
